<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>pathconvert</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>pathconvert</b> -  pathnames convertion between posix and windows.  </p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>paths=pathconvert(paths [,flagtrail [,flagexpand [,type]]])  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>paths</b>
        </tt>: a string matrix giving a set of pathnames</li>
      <li>
        <tt>
          <b>flagtrail,flagexpand</b>
        </tt>: boolean optional parameters (default value depends on  the MSDOS variable).</li>
      <li>
        <tt>
          <b>type</b>
        </tt>: a string <tt>
          <b>'u'</b>
        </tt> or <tt>
          <b>'w'</b>
        </tt>.</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>pathconvert</b>
      </tt> can be used to convert a set of pathnames
    (given by a string matrix <tt>
        <b>paths</b>
      </tt>) from windows native 
    filename to posix-style pathnames and back. The target style 
    is given by the optional string <tt>
        <b>type</b>
      </tt> which can be 
    <tt>
        <b>'u'</b>
      </tt> for Unix or <tt>
        <b>'w'</b>
      </tt> for Windows. The default 
    style is set according to the value of <tt>
        <b>MSDOS</b>
      </tt>. 
    If <tt>
        <b>MSDOS</b>
      </tt> is true (resp. false ) then default type is <tt>
        <b>'w'</b>
      </tt>
    (resp.  <tt>
        <b>'u'</b>
      </tt>).</p>
    <p>
    Windows pathnames starting with <tt>
        <b>name:</b>
      </tt> are converted to 
    pathnames starting with <tt>
        <b>/cygdrive/name/</b>
      </tt> using the cygwin 
    convention.</p>
    <p>
      <tt>
        <b>flagtrail</b>
      </tt> is an optional boolean parameter. When its value 
    is true a trailing separator (<tt>
        <b>'\'</b>
      </tt> or <tt>
        <b>'/'</b>
      </tt>) is added 
    at the end of the path.</p>
    <p>
      <tt>
        <b>flagexpand</b>
      </tt> is an optional boolean parameter. When its value 
    is true leading strings like  <tt>
        <b>HOME</b>
      </tt>, <tt>
        <b>SCI</b>
      </tt> or <tt>
        <b>~</b>
      </tt> are 
    expanded using environment variables.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

pathconvert('SCI/macros\util/foo.sci',%f,%f,'u')
pathconvert('SCI/macros\util/foo.sci',%f,%f,'w')
pathconvert('SCI/macros/util/foo.sci',%f,%t,'w')
pathconvert('HOME/macros/util/foo.sci',%t,%t,'w')
pathconvert('c:/tmp',%f,%t,'u')
pathconvert('/cygdrive/c/tmp',%f,%f,'w')
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="basename.htm">
        <tt>
          <b>basename</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="listfiles.htm">
        <tt>
          <b>listfiles</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
